<?php

namespace app\model;

use support\Db;
use support\Model;

class WaConfig
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'wa_config';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';

    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    public static function find($condition = [])
    {
        $res = Db::table('wa_config')
            ->where($condition)
            ->first();
        return json_encode($res);
    }

    public static function updated($condition, $data)
    {


        return Db::table('wa_config')->where($condition)->update($data);

    }


}